#include <stdio.h>
#include <malloc.h>
struct node
{
	int num;
	struct node *next;
};

typedef struct
{
	struct node *start;
	int noe;
}list;

void list_append(list *a, int num)
{
	if(a->start==NULL)
	{
		a->start = (struct node *)malloc(sizeof(struct node));
		a->start->next = NULL;
		a->noe = 1;
	}	
	else
	{
		struct node* ptr = a->start;
		while(ptr->next!=NULL)
			{
				ptr = ptr->next;
			}
		ptr->next = (struct node *)malloc(sizeof(struct node));
		ptr->next->num = num;
		ptr->next->next = NULL;
		a->noe++;
	}	
}

int list_pop(list *a)
{
	struct node* ptr = a->start;
	if(ptr==NULL)
	{
		return;
	}
	else if(ptr->next==NULL)
	{
		int temp = ptr->num;
		ptr = NULL;
		return temp;
	}
	else
	{
		while(ptr->next->next!=NULL)
			{
				ptr = ptr->next;
			}
		int temp = ptr->next->num;
		free (ptr->next);
		ptr = NULL;
		return temp;
	}
}

void list_insert(list *a, int x, int pos)
{	
	if(pos > a->noe)
	{
		return;
	}
	else
	{
		
	}
}

list_extend()
{}

list_remove()
{}

list_index()
{}

list_count()
{}

int main()
{}
